//
//  LTView.m
//  UI03_UIViewController_CustomView
//
//  Created by wyx on 16/3/11.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "LTView.h"

@interface LTView ()

@end
@implementation LTView
- (void)dealloc{
    [_lableOfLeft release];
    [_textFieldOfRight release];
    [super dealloc];
}
#pragma mark - Creating and init
- (instancetype)initWithFrame:(CGRect)frame withText:(NSString *)text placeHolder:(NSString *)placeHolder {
    self = [super initWithFrame:frame];
    if (self) {
        //创建子视图对象
        [self createSubViewWithFrame:frame];
        self.lableOfLeft.text = text;
        self.textFieldOfRight.placeholder = placeHolder;
        
    }
    return self;
}
- (void)createSubViewWithFrame:(CGRect)frame{//参数根据需求
    self.lableOfLeft = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width / 3, frame.size.height)];
    [self addSubview:self.lableOfLeft];
    [_lableOfLeft release];
    self.textFieldOfRight = [[UITextField alloc] initWithFrame:CGRectMake(frame.size.width / 3, 0, frame.size.width / 3 * 2, frame.size.height)];
    [self addSubview:_textFieldOfRight];
    self.textFieldOfRight.borderStyle = 3;
    [_textFieldOfRight release];
}


@end
